﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using System.Windows;

namespace Project_CFT2
{
  public class myFurnitureDataItem : DependencyObject
  {
    // Note how the TitleProperty is a DependencyProperty, and the Title CLR property is
    // here just for convenience. The string itself is not stored in the object, it's
    // stored in the WPF framework.

     
    public string name
    {
        get
        {
            return (string)GetValue(nameProperty);
        }
        set
        {
            SetValue(nameProperty, value);
        }
    }
     public int ID
     {
         get
         {
             return (int)GetValue(IDProperty);
         }
         set
         {
             SetValue(IDProperty, value);
         }
     }
     
     public string description
     {
         get
         {
             return (string)GetValue(descriptionProperty);
         }
         set
         {
             SetValue(descriptionProperty, value);
         }
     }
   
     public string type
     {
         get
         {
             return (string)GetValue(typeProperty);
         }
         set
         {
             SetValue(typeProperty, value);
         }
     }
        public int sub_type
        {
            get
            {
                return (int)GetValue(sub_typeProperty);
            }
            set
            {
                SetValue(sub_typeProperty, value);
            }
        }
              public int type_id
               {
                   get
                   {
                       return (int)GetValue(type_idProperty);
                   }
                   set
                   {
                       SetValue(type_idProperty, value);
                   }
               }
             
         public float price
         {
             get
             {
                 return (float)GetValue(priceProperty);
             }
             set
             {
                 SetValue(priceProperty, value);
             }
         }
         public int length
         {
             get
             {
                 return (int)GetValue(lengthProperty);
             }
             set
             {
                 SetValue(lengthProperty, value);
             }
         }
         public int width
         {
             get
             {
                 return (int)GetValue(widthProperty);
             }
             set
             {
                 SetValue(widthProperty, value);
             }
         }
         public int height
         {
             get
             {
                 return (int)GetValue(heightProperty);
             }
             set
             {
                 SetValue(heightProperty, value);
             }
         }
         public int available_colours
         {
             get
             {
                 return (int)GetValue(available_coloursProperty);
             }
             set
             {
                 SetValue(available_coloursProperty, value);
             }
         }
    
     public string colour1
     {
         get
         {
             return (string)GetValue(colour1Property);
         }
         set
         {
             SetValue(colour1Property, value);
         }
     }

     public string colour2
     {
         get
         {
             return (string)GetValue(colour2Property);
         }
         set
         {
             SetValue(colour2Property, value);
         }
     }
     public string colour3
     {
         get
         {
             return (string)GetValue(colour3Property);
         }
         set
         {
             SetValue(colour3Property, value);
         }
     }
     public string colour4
     {
         get
         {
             return (string)GetValue(colour4Property);
         }
         set
         {
             SetValue(colour4Property, value);
         }
     }
     public string im_src
     {
         get
         {
             return (string)GetValue(im_srcProperty);
         }
         set
         {
             SetValue(im_srcProperty, value);
         }
     }
     // Using a DependencyProperty as the backing store for Title.  This enables animation, styling, binding, etc...
    
     public static readonly DependencyProperty descriptionProperty =
       DependencyProperty.Register("description", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
     public static readonly DependencyProperty typeProperty =
       DependencyProperty.Register("type", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
    
     
   
     public static readonly DependencyProperty colour1Property =
       DependencyProperty.Register("colour1", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
     public static readonly DependencyProperty colour2Property =
       DependencyProperty.Register("colour2", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
     public static readonly DependencyProperty colour3Property =
       DependencyProperty.Register("colour3", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
     public static readonly DependencyProperty colour4Property =
       DependencyProperty.Register("colour4", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
         public static readonly DependencyProperty priceProperty =
           DependencyProperty.Register("price", typeof(float), typeof(myFurnitureDataItem), new UIPropertyMetadata((float)0));
         public static readonly DependencyProperty im_srcProperty =
           DependencyProperty.Register("im_src", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));

          public static readonly DependencyProperty sub_typeProperty =
                 DependencyProperty.Register("sub_type", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
         public static readonly DependencyProperty nameProperty =
             DependencyProperty.Register("name", typeof(string), typeof(myFurnitureDataItem), new UIPropertyMetadata(""));
          public static readonly DependencyProperty IDProperty =
              DependencyProperty.Register("ID", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
           
           public static readonly DependencyProperty type_idProperty =
            DependencyProperty.Register("type_id", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
          public static readonly DependencyProperty lengthProperty =
            DependencyProperty.Register("length", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
          public static readonly DependencyProperty widthProperty =
            DependencyProperty.Register("width", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
          public static readonly DependencyProperty heightProperty =
            DependencyProperty.Register("height", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
          public static readonly DependencyProperty available_coloursProperty =
            DependencyProperty.Register("available_colours", typeof(int), typeof(myFurnitureDataItem), new UIPropertyMetadata(0));
      /*
     
          public myDataItem( string name, string id, string type, string price, string image)
          {
              Title = name;
              ID = id;
              Type = type;
              Price = price;
              Image = image;
      
          }
           */
    public myFurnitureDataItem(Furniture x)
    {
        ID = (int)x.ID;
        name = x.name.ToString();
        description = x.description.ToString();
        type = x.type.ToString();
        sub_type = (int)x.sub_type;
        type_id = (int)x.type_id;
        length = (int)x.length;
        width = (int)x.width;
        height = (int)x.height;
        available_colours = (int)x.available_colours;
        colour1 = x.colour1.ToString();
        colour2 = x.colour2.ToString();
        colour3 = x.colour3.ToString();
        colour4 = x.colour4.ToString();
        price = (float)x.price;
        im_src = x.im_src.ToString();

    }
  }
}
